package cn.akwangl.design.pattern.creational.singleton;

/**
 * 单例模式v1. 懒汉单例
 *
 * @author youyongkun
 * @date 2021/11/24 16:18
 */
public class LazySingleton {

    private static LazySingleton lazySingleton = null;

    private LazySingleton() {

    }

    public synchronized static LazySingleton instance() {
        if (lazySingleton == null) {
            lazySingleton = new LazySingleton();
        }
        return lazySingleton;
    }
}
